{$layout}

{$template "menu"}

<form class="ui form" data-tea-action="/agents/apps/update" data-tea-success="submitSuccess">
    <input type="hidden" name="agentId" :value="agentId"/>
    <input type="hidden" name="appId" :value="app.id"/>
    <table class="ui table definition">
        <tr>
            <td class="title">App名称</td>
            <td>
                <input type="text" name="name" maxlength="100" v-model="app.name"/>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <a href="" style="font-weight: normal;" v-if="!advancedOptionsVisible" @click.prevent="showAdvancedOptions()">更多选项 <i class="icon angle down"></i> </a>
                <a href="" style="font-weight: normal;" v-if="advancedOptionsVisible" @click.prevent="showAdvancedOptions()">收起选项 <i class="icon angle up"></i> </a>
            </td>
        </tr>
        <tbody v-show="advancedOptionsVisible">
			<tr>
				<td>共享</td>
				<td>
					<div class="ui checkbox">
						<input type="checkbox" name="isSharedWithGroup" value="1" id="share-with-group-box" v-model="app.isSharedWithGroup"/>
						<label for="share-with-group-box">与本组下的所有Agent共享</label>
					</div>
					<p class="comment" style="margin-top:0.6em">如果选择了共享此App，则对当前App的操作也会自动同步到当前分组下的其他Agent中。</p>
				</td>
			</tr>
            <tr>
                <td>是否启用</td>
                <td>
                    <div class="ui checkbox">
                        <input type="checkbox" name="on" value="1" v-model="app.on"/>
                        <label></label>
                    </div>
                </td>
            </tr>
        </tbody>
    </table>

    <button class="ui button primary" type="submit">保存</button> &nbsp; <a :href="from">返回</a>
</form>